package com.javasm.maimaibao.login.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.javasm.maimaibao.login.dao.AdminUserDao;
import com.javasm.maimaibao.login.entity.AdminUser;
import com.javasm.maimaibao.login.service.AdminUserService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 后台用户(AdminUser)表服务实现类
 *
 * @author makejava
 * @since 2025-02-12 15:57:30
 */
@Service("adminUserService")
public class AdminUserServiceImpl extends ServiceImpl<AdminUserDao, AdminUser> implements AdminUserService {

//手机号登录
    @Override
    public AdminUser getByName(String username) {
        LambdaUpdateWrapper<AdminUser> lambdaUpdateWrapper=new LambdaUpdateWrapper<>();
        lambdaUpdateWrapper.eq(AdminUser::getUsername,username);
        AdminUser userDetail = this.getOne(lambdaUpdateWrapper);
        return userDetail;
    }
//验证码登录
    @Override
    public AdminUser phoneLogin() {

        return null;
    }

    @Override
    public AdminUser getByPhone(String phone) {
        LambdaUpdateWrapper<AdminUser> lambdaUpdateWrapper=new LambdaUpdateWrapper<>();
         lambdaUpdateWrapper.eq(AdminUser::getPhone, phone);
        AdminUser phoneUserInfo = getOne(lambdaUpdateWrapper);
        return phoneUserInfo;
    }
}

